var xtKnowledgeWinAdd;
var xtKnowledgeFormAdd;
function addXtKnowledge(){
	initXtKnowledgeFormAdd();
	reGetWidthAndHeight();
	xtKnowledgeWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:clientWidth*0.8,                    
		height:clientHeight, 
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtKnowledgeFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtKnowledgeFormAdd,'../xtKnowledgeController/addXtKnowledge',grid,xtKnowledgeWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtKnowledgeWinAdd.show();
}
function initXtKnowledgeFormAdd(){
	xtKnowledgeFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:66,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		/**新方法使用开始**/  
        scrollable:true,  
        scrollable:'x',
        scrollable:'y',
        /**新方法使用结束**/ 
		items:[
		{
			fieldLabel:'标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题',
			xtype:'textfield',
			name:'xt_knowledge_title',
			allowBlank:false,
			maxLength:200,
			trigger1Cls:'x-form-cl-trigger',
			onTrigger1Click:function(){this.setValue(''); this.fireEvent('clear', this)},
			anchor:'100%'
		},
		{
			fieldLabel:'类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型',
			name:"xt_type",
            hiddenName:'xt_type',
            xtype:"combo",
            store:[["-1","请选择"],["0","平台问题"],["1","学习知识"]],
            emptyText:"请选择",
            mode:"local",
            triggerAction:"all",
            editable:false,
			allowBlank:false,
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态',
			name:"xt_state",
            hiddenName:'xt_state',
            xtype:"combo",
            store:[["-1","请选择"],["0","待解决"],["1","已解决"]],
            emptyText:"请选择",
            mode:"local",
            triggerAction:"all",
            editable:false,
			allowBlank:false,
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别',
			name:'xt_level',
            hiddenName:'xt_level',
            xtype:"combo",
            store:[["-1","请选择"],["1","紧急"],["2","正常"],["3","一般"]],
            emptyText:"请选择",
            mode:"local",
            triggerAction:"all",
            editable:false,
			allowBlank:false,
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容',
			xtype:'htmleditor',
			name:'xt_knowledge_content',
			allowBlank:false,
			height:280,
			maxLength:4294967295,
			anchor:'100%'
			/**
			createLinkText:'创建超链接',//创建连接的提示信息
			defaultLinkValue:"http://www.",//连接的默认格式
			enableAlignments:true,//起用左、中、右对齐按钮
			enableColors:true,//起用前景色、背景色选择按钮
			enableFont:true,//起用字体选择按钮
			enableFontSize:true,//起用字体增大和缩写按钮
			enableFormat:true,//起用粗体、斜体、下划线按钮
			enableLinks:true,//起用创建连接按钮
			enableLists:true,//起用列表按钮
			enableSourceEdit:true,//起用源代码编辑按钮
			fontFamilies:['宋体','隶书','黑体'],//字体列表
			**/
		}
		]
	});
}
